package com.memorypalace.user.biz;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.memorypalace.deck.mapper.NoteTypeMapper;
import com.memorypalace.pojo.NoteType;
import com.memorypalace.pojo.User;
import com.memorypalace.user.mapper.RegisterUserMapper;

@Service("registerUserBiz")
public class RegisterUserBizmpl implements IRegisterUserBiz{
	
	@Autowired
	private RegisterUserMapper registerUserMapper;
	@Autowired
	private NoteTypeMapper noteTypeMapper;
	//注册

	@Override
	public Boolean registerUser(User user) {
		
		try {
			// 新建用户对象
			registerUserMapper.registerUser(user);
			
			return true;
		} catch (Exception e) {
			e.printStackTrace();
			return false;
		}
		
	}

	@Override
	public Boolean getUserByUserName(User user) {
		User nuser = registerUserMapper.getUserByUserName(user);
		return (nuser == null) ? true : false;
	}

	@Override
	public Boolean getUserByUserEmail(User user) {
		User muser = registerUserMapper.getUserByUserEmail(user);
		return (muser == null) ? true : false;
	}

	

	
	}


